#ifndef ALFS_GUI_ACTIONMAP_H
#define ALFS_GUI_ACTIONMAP_H

// File [alfs/gui/ActionMap.h].
//
// ActionMap.
//
// An ActionMap associates UserCommand::Id's with actions.
//
// (c) copyright Alf P. Steinbach 2008.
// Use, modification and distribution are subject to the "New BSD License"
// as listed at <url: http://www.opensource.org/licenses/bsd-license.php>.

#include    "InvocableUserCommandTree.h"    // InvocableUserCommand, InvokableUserCommandTree
#include    <map>                           // std::map

namespace alfs{

#   define  ThisClass   ActionMap

    class ThisClass
    {
    private:
        typedef std::map< UserCommand::Id, InvocableUserCommand::Action>  Map;

        Map myMap;

    public:
        ThisClass();
        ThisClass( InvocableUserCommandTree::Ptr commands );

        void swap( ThisClass& other );
        void clear();

        void setActionFor( UserCommand::Id commandId, InvocableUserCommand::Action action );
        void copyActionsFrom( InvocableUserCommandTree::Ptr commands );
        InvocableUserCommand::Action actionFor( UserCommand::Id id ) const;
    };
#undef  ThisClass

}  // alfs

#endif
